package com.wyk.controller;

import com.wyk.domain.CommonResult;
import com.wyk.service.StorageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author WangYuKai
 * @Date 2022/8/4
 * @apiNote
 */
@RestController
public class StorageController {
    @Autowired
    private StorageService service;

    @PostMapping("/storage/decrease")
    public CommonResult decrease(Long productId,Integer count){
        service.updateStorageCount(productId, count);
        return new CommonResult(200,"扣减库存成功");
    }
}
